/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package dao;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 *
 * @author bruno
 */
public class DCriaConexao {
    public static Connection conexao() throws SQLException{
        try {
            Class.forName("com.mysql.jdbc.Driver");
            return DriverManager.getConnection("jdbc:mysql://127.0.0.1/biblioteca_tux","root","");
        } catch (ClassNotFoundException ex) {
           throw new SQLException(ex.getMessage());//Se tiver algum erro, esta parte do código vai passar o erro para o método que chamou
        }
    }
}
